package com.smh.ZongHeLianXi;

public class Test4 {
    public static void main(String[] args) {


        System.out.println(getCount(20));
        System.out.println(getCount2(20));


    }
    //
    /*
    *   1
    *   2
    *
    *
    *
    * */


    public static int getCount(int jie){
        if (jie==1){
            return 1;
        }
        if (jie==2){
            return 2;
        }
        return getCount(jie-1)+getCount(jie-2);

    }
    public static int getCount2(int jie){
        if (jie==1){
            return 1;
        }
        if (jie==2){
            return 2;
        }
        if (jie==3){
            return 4;
        }
        return getCount2(jie-1)+getCount2(jie-2)+getCount2(jie-3);

    }
}
